<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>canvas</title>
</head>
<body>
    <canvas id="canvas" width="500" height="500"></canvas>
</body>
<script>
    let data = [.3,.5,.6,.9,.4];
    let ctx = document.getElementById("canvas").getContext("2d");
    ctx.fillStyle = "#2979ff";
    for(let i = 0; i<= 5; i++){
        let db = data[i];
        ctx.fillRect(45 + i*100,500 - db*500 - 40,50, db*500);
    }

    ctx.fillStyle = "black";
    ctx.lineWidth = 2.0;
    ctx.beginPath();
    ctx.moveTo(30,10);
    ctx.lineTo(30,460);
    ctx.lineTo(500,460)
    ctx.stroke();

    let labels = ["JAN", "FEB", "MAR", "APR", "MAY"];
    for(let i = 0 ; i <= 5; i++){
        ctx.fillText(labels[i], 60 + i * 100 ,480);
    }
    
    ctx.fillStyle ="black";
    for(let i = 0 ; i <=6;i++){
        ctx.fillRect(25,83*i-40,5,2);
    }

    for(let i = 5; i >= 0; i--){
        console.log(i*20)
        ctx.fillText(i*20,0,83*(6-i)-35)
    }
    

</script>
</html>